'''
Created on Sep 5, 2012

@author: peng
'''
import unittest
import urllib
from datetime import datetime
from time import mktime
from hashlib import md5
import httplib, urllib
import base64
import json
import gzip
import cStringIO


class Test(unittest.TestCase):

    conn = httplib.HTTPConnection("127.0.0.1:8000")

    def test_login(self):
        print 'test_event'
        self.conn.request("POST", 
                     "/accounts/login/",
                     '{"username":"prong","password":"test1", "csrfmiddlewaretoken":"AZlF7PYpl4EWtTRC8qb37swc9pMeBKSG"')
        response = self.conn.getresponse()
        print response.status, response.reason
        data = response.read()
        print data


if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()